<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon.ico?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="面试题,">










<meta name="description" content="面试题####1.简述清楚浮动的几种方案  伪类 :after 12345678:after &amp;#123;    clear: both;    content: &apos;&apos;;    display: block;    width: 0;    height: 0;    visibility: hidden;&amp;#125;  在最后添加新元素并设置 css 属性为  clear:both  为父元素添">
<meta name="keywords" content="面试题">
<meta property="og:type" content="article">
<meta property="og:title" content="一些面试题">
<meta property="og:url" content="http://zhanglei_c.gitee.io/blog/2019/10/08/一些面试题/index.html">
<meta property="og:site_name" content="爱吃零食的猫">
<meta property="og:description" content="面试题####1.简述清楚浮动的几种方案  伪类 :after 12345678:after &amp;#123;    clear: both;    content: &apos;&apos;;    display: block;    width: 0;    height: 0;    visibility: hidden;&amp;#125;  在最后添加新元素并设置 css 属性为  clear:both  为父元素添">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-12-13T12:29:14.021Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="一些面试题">
<meta name="twitter:description" content="面试题####1.简述清楚浮动的几种方案  伪类 :after 12345678:after &amp;#123;    clear: both;    content: &apos;&apos;;    display: block;    width: 0;    height: 0;    visibility: hidden;&amp;#125;  在最后添加新元素并设置 css 属性为  clear:both  为父元素添">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://zhanglei_c.gitee.io/blog/2019/10/08/一些面试题/">





  <title>一些面试题 | 爱吃零食的猫</title>
  








</head>

<script type="text/javascript" color="0,0,255" opacity="0.7" zindex="-2" count="99" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
<a href="https://github.com/403NotFound" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewbox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"/><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">爱吃零食的猫</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">自由，平等，公正，法治</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/blog/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://zhanglei_c.gitee.io/blog/blog/2019/10/08/一些面试题/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Zhang_lei">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="爱吃零食的猫">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">一些面试题</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-10-08T14:15:52+08:00">
                2019-10-08
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="面试题"><a href="#面试题" class="headerlink" title="面试题"></a>面试题</h1><p>####1.简述清楚浮动的几种方案</p>
<ul>
<li><p>伪类 <code>:after</code></p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-pseudo">:after</span> &#123;</span><br><span class="line">    <span class="attribute">clear</span>: both;</span><br><span class="line">    <span class="attribute">content</span>: <span class="string">''</span>;</span><br><span class="line">    <span class="attribute">display</span>: block;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">0</span>;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">0</span>;</span><br><span class="line">    <span class="attribute">visibility</span>: hidden;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>在最后添加新元素并设置 css 属性为  <code>clear:both</code></p>
</li>
<li><p>为父元素添加 css 属性 <code>overflow: hidden</code></p>
</li>
<li><p>为父元素设置定高</p>
</li>
</ul>
<p>####2.<code>javascript</code> 中有哪些定时器，他们的区别是啥</p>
<ul>
<li><code>setTimeout</code><ul>
<li>设置一个定时器，定时器到期后执行定时器中的函数</li>
</ul>
</li>
<li><code>setInterval</code><ul>
<li>定时的执行一次定时器中的函数</li>
</ul>
</li>
<li>主要区别就是执行次数的不同<code>setTimeout</code>只执行一次，<code>setInterval</code>  n次</li>
</ul>
<p>####3.<code>display: none</code> 和 <code>visibility: hidden</code> 的区别</p>
<ul>
<li><code>display</code> 隐藏的元素不占用原来的空间</li>
<li><code>visibility</code> 只是视觉上的隐藏，但是元素原来所占用的空间还在</li>
</ul>
<p>####4.body中的<code>onload()</code>和jQuery中的<code>document.ready()</code>有什么区别</p>
<ul>
<li>加载程度不同，执行次数不同，执行速度不同<ul>
<li>加载程度不同<ul>
<li><code>document.ready()</code>  在DOM加载完成后就可以对DOM进行操作了，一般情况下一个页面加载的顺序是，域名解析 –&gt; 加载html –&gt; 加载js和css –&gt; 加载图片等其他信息，<code>document.ready()</code> 一般在加载js和css 和 加载图片等其他信息 之间就可以操作DOM了</li>
<li><code>onload()</code>  在document文档加载完成后就可以对DOM进行操作，一般在加载图片等其他信息之后</li>
</ul>
</li>
<li>执行次数不同<ul>
<li><code>document.ready()</code>可以执行多次且不会被覆盖</li>
<li><code>onload()</code> 只能执行一次，如果有多个，则第一次的执行会被覆盖</li>
</ul>
</li>
<li>执行速度不同<ul>
<li>由于<code>onload()</code>还需等待图片等其他资源加载完毕所以<code>document.ready()</code>速度会快于<code>onload()</code></li>
</ul>
</li>
</ul>
</li>
</ul>
<p>####5.说出几种减少页面加载时间的方法</p>
<ul>
<li>减少重复的 http 请求</li>
<li>压缩JavaScript css 代码</li>
<li>在头部放置css样式的定义</li>
<li>在文件末尾放置JavaScript脚本</li>
<li>css,js 改用外部调用</li>
<li>减少DOM元素</li>
<li>使用CDN来加速</li>
<li>避免重复的调用脚本文件</li>
<li>．．．</li>
</ul>
<p>####6.Vue组件间传值问题</p>
<ul>
<li><p>父传子</p>
<blockquote>
<p>通过标签间属性来传递，子组件通过<code>props</code>来接收</p>
</blockquote>
</li>
<li><p>子传父</p>
<blockquote>
<p>子组件通过触发事件的方式向父组件传参 </p>
<p>父组件通过监听这个触发事件来获取子组件传递过来的参数</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&gt; <span class="comment">// son</span></span><br><span class="line">&gt; <span class="keyword">this</span>.$emit(<span class="string">'functionName'</span>,value)</span><br><span class="line">&gt;</span><br></pre></td></tr></table></figure>
</blockquote>
</li>
<li><p>兄弟间传值</p>
<blockquote>
<p>兄弟组件间可以通过<code>Bus</code>总线的方式传参</p>
</blockquote>
</li>
<li><p>Vuex</p>
</li>
</ul>
<p>####7.Vue的优缺点</p>
<ul>
<li>优点<ul>
<li>性能好</li>
<li>简单易用</li>
<li>前后端分离</li>
<li>单页面用户体验好</li>
</ul>
</li>
<li>缺点<ul>
<li>不利于<code>SEO</code>(搜索引擎优化）</li>
<li>封装性较好，报错不明显，适合中小型项目</li>
</ul>
</li>
</ul>
<p>####8.描述 cookie 、sessionStorage 、localStorage 的区别</p>
<ul>
<li>cookie 由服务端生成发送到用户本地客户端的数据，又叫回话跟踪技术，一般包含用户的相关信息</li>
<li>sessionStorage 针对一个 session 的数据存储，当用户关闭浏览器窗口后，数据会被清除</li>
<li>localStorage 保存在本地的数据，没有时间限制</li>
</ul>
<blockquote>
<p>共同点：都保存在浏览器端，同源</p>
<p>区别:</p>
<ul>
<li>cookie 始终在 http请求中携带，只要服务端向客户端写了cookie 那么客户端接下来的每次请求都会带上cookie去请求服务端，cookie 有路径的概念，可以限制cookie只属于某个路径下，数据大小不能超过4k,所以 cookie 只适合很小的数据存储 </li>
<li>sessionStorage 和 localStorage 不会自动的吧数据发送到服务端，仅在本地保存。大小限制为5M</li>
<li>数据有效期不同: sessionStorage只在浏览器窗口关闭前有效，localStorage永久有效，cookie在他规定的时间内有效，即使浏览器窗口关闭</li>
<li>作用域不同：sessionStorage不在不同的浏览器窗口共享，localStorage在所有的同源窗口下共享，cookie也在所有同源浏览器窗口下共享</li>
</ul>
</blockquote>
<h4 id="9-H5中的新标签不兼容如何处理？"><a href="#9-H5中的新标签不兼容如何处理？" class="headerlink" title="9.H5中的新标签不兼容如何处理？"></a>9.H5中的新标签不兼容如何处理？</h4><p>引用 Google 的 <code>HTML5.js</code> 即可搞定。</p>
<p>####10.为什么HTML5 的 DOCTYPE 只需要写 <code>&lt;!DOCTYPE html&gt;</code> ？</p>
<p>H4的 DOCTYPE 需要对 <code>DTD</code> 进行引用，因为 H4 基于<code>SGML</code>，而 H5 不基于 <code>SGML</code> ，所以不需要对 <code>DTD</code> 进行引用，<code>SGML</code> 是通用标记语言，<code>HTML</code> ， <code>xml</code>都是由 <code>SGML</code> 发展而来，但是 H5 不是。</p>
<h4 id="11-JS-同步与异步的区别？"><a href="#11-JS-同步与异步的区别？" class="headerlink" title="11.JS 同步与异步的区别？"></a>11.JS 同步与异步的区别？</h4><p>由于JavaScript 是一门单线程语言，所以一次只能执行一个任务，如果有多个任务就必须排队，前面一个任务完成，在执行下一个任务。好处就是比较简单，坏处就是一旦其中某个任务时间较长，后面的任务等待时间就会变长，导致程序“卡住”。</p>
<p>为解决这个问题，js 将任务执行模式分为两种，同步（Synchronous）和异步（Asynchronous）</p>
<ul>
<li><p>同步</p>
<blockquote>
<p>后一个任务等待前一个任务的执行完毕，然后再执行，程序的执行顺序与任务的排列顺序一致</p>
</blockquote>
</li>
<li><p>异步</p>
<blockquote>
<p>异步模式就是每一个任务都有一个回调函数，每一个任务执行完毕后不是去执行后一个任务，而是去执行回调函数，后一个任务则不是等待前一个任务结束就执行。</p>
</blockquote>
</li>
</ul>
<p><strong>异步编程的 4 种方式：</strong></p>
<ol>
<li>回调函数</li>
<li>监听事件</li>
<li>发布订阅</li>
<li>Promise</li>
</ol>
<p>####12.<code>for...in</code>和<code>for...of</code>的区别?</p>
<p>for in 是ES5标准，遍历key。（可遍历对象、数组、字符串的key）</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> obj = &#123;<span class="attr">a</span>:<span class="number">1</span>, <span class="attr">b</span>:<span class="number">2</span>&#125;</span><br><span class="line"><span class="keyword">var</span> arr = [&#123;<span class="attr">a</span>:<span class="number">1</span>&#125;,&#123;<span class="attr">b</span>:<span class="number">2</span>&#125;]</span><br><span class="line"><span class="keyword">var</span> str = <span class="string">'hello'</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">let</span> key <span class="keyword">in</span> obj) &#123;</span><br><span class="line">    <span class="built_in">console</span>.log(key) <span class="comment">// a b</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">let</span> key <span class="keyword">in</span> arr) &#123;</span><br><span class="line">    <span class="built_in">console</span>.log(key) <span class="comment">// 0 1</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">let</span> key <span class="keyword">in</span> str) &#123;</span><br><span class="line">    <span class="built_in">console</span>.log(key) <span class="comment">// 0 1 2 3 4</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">// for in 只遍历 key 值</span></span><br></pre></td></tr></table></figure>
<p>for of 是ES6标准，遍历value。（可遍历数组、字符串的value）</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> obj = &#123;<span class="attr">a</span>:<span class="number">1</span>, <span class="attr">b</span>:<span class="number">2</span>&#125;</span><br><span class="line"><span class="keyword">var</span> arr = [&#123;<span class="attr">a</span>:<span class="number">1</span>&#125;,&#123;<span class="attr">b</span>:<span class="number">2</span>&#125;]</span><br><span class="line"><span class="keyword">var</span> str = <span class="string">'hello'</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">let</span> key <span class="keyword">of</span> obj) &#123;</span><br><span class="line">    <span class="built_in">console</span>.log(key) <span class="comment">// 报错 obj is not iterable 对象不可迭代</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">let</span> key <span class="keyword">of</span> arr) &#123;</span><br><span class="line">    <span class="built_in">console</span>.log(key) <span class="comment">// &#123;a:1&#125; &#123;b:2&#125;</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">let</span> key <span class="keyword">of</span> str) &#123;</span><br><span class="line">    <span class="built_in">console</span>.log(key) <span class="comment">// h e l l o</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="13-什么是纯函数以及为什么要使用纯函数？"><a href="#13-什么是纯函数以及为什么要使用纯函数？" class="headerlink" title="13.什么是纯函数以及为什么要使用纯函数？"></a>13.什么是纯函数以及为什么要使用纯函数？</h4><ul>
<li><p><strong>什么是纯函数</strong></p>
<p>一个函数的返回结果只依赖他的参数，并且执行过程中无任何副作用，则这个函数称之为纯函数</p>
</li>
<li><p><strong>为什么要使用纯函数</strong></p>
<p>因为纯函数在执行过程中不会产生任何副作用，内部不会产生不可预料的突变，也不会对外部产生影响，只要参数确定，那么他的返回值就确定，非常利于调试和测试。</p>
</li>
</ul>
<h4 id="14-setTimeout为什么会出现误差？"><a href="#14-setTimeout为什么会出现误差？" class="headerlink" title="14.setTimeout为什么会出现误差？"></a>14.setTimeout为什么会出现误差？</h4><p>setTimeout是一个异步的宏任务，当执行setTimeout时是将回调函数在指定的时间后放入宏任务队列。如果此时主线程有很多同步代码在等待执行，或者微任务队列以及当前宏任务队列之前还有很多任务在队列中等待执行，则必须等待他们执行完毕后才能执行setTimeout的回调函数，所以不能保证在setTimeout中指定的时间立刻执行回调函数。</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/面试题/" rel="tag"># 面试题</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2019/04/28/firstBlog/" rel="next" title="DOM树的遍历">
                <i class="fa fa-chevron-left"></i> DOM树的遍历
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2019/10/08/html-css-基础/" rel="prev" title="html-css-基础">
                html-css-基础 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Zhang_lei</p>
              <p class="site-description motion-element" itemprop="description">爱吃零食的猫</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">43</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/blog/tags/index.html">
                  <span class="site-state-item-count">22</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/403NotFound" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/ai-chi-bao-mi-hua-de-mao/activities" target="_blank" title="知乎">
                      
                        <i class="fa fa-fw fa-send"></i>知乎</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gitee.com/ZhangLei_c" target="_blank" title="码云">
                      
                        <i class="fa fa-fw fa-github-alt"></i>码云</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5205419998/profile?rightmod=1&wvr=6&mod=personinfo&is_all=1" target="_blank" title="weibo">
                      
                        <i class="fa fa-fw fa-weibo"></i>weibo</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#面试题"><span class="nav-number">1.</span> <span class="nav-text">面试题</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#9-H5中的新标签不兼容如何处理？"><span class="nav-number">1.0.0.1.</span> <span class="nav-text">9.H5中的新标签不兼容如何处理？</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#11-JS-同步与异步的区别？"><span class="nav-number">1.0.0.2.</span> <span class="nav-text">11.JS 同步与异步的区别？</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#13-什么是纯函数以及为什么要使用纯函数？"><span class="nav-number">1.0.0.3.</span> <span class="nav-text">13.什么是纯函数以及为什么要使用纯函数？</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#14-setTimeout为什么会出现误差？"><span class="nav-number">1.0.0.4.</span> <span class="nav-text">14.setTimeout为什么会出现误差？</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Zhang_lei</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>


<div>
<span id="busuanzi_container_site_pv">
  本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>
<span id="busuanzi_container_site_uv">
    有<span id="busuanzi_value_site_uv"></span>人看过我的博客啦
</span>
</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/blog/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
